package com.dongdongshop.controller;

import com.dongdongshop.domain.AjaxResult;
import com.dongdongshop.pojo.TbSeller;
import com.dongdongshop.service.Seller1Service;
import em.ResuleEnum;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("seller1")
public class Seller1Controller {
    @DubboReference
    private Seller1Service seller1Service;

    @RequestMapping("seller1Show")
    public String seller1Show(){
        return "admin/seller_1";
    }

    @RequestMapping("seller1List")
    @ResponseBody
    public AjaxResult seller1List(TbSeller tbSeller){
        List<TbSeller> list =seller1Service.seller1List(tbSeller);
        return AjaxResult.R(ResuleEnum.SUCCESS).setData(list);
    }

    @RequestMapping("selectById")
    @ResponseBody
    public AjaxResult selectById(String sellerId){
        TbSeller tbSeller = seller1Service.selectById(sellerId);
        return AjaxResult.R(ResuleEnum.SUCCESS).setData(tbSeller);
    }

//    @RequestMapping("shenheYes")
//    @ResponseBody
//    public AjaxResult shenheYes(String sellerId,String status){
//        seller1Service.shenheYes(sellerId,status);
//        return AjaxResult.R(ResuleEnum.SUCCESS);
//    }

    @RequestMapping("shenheYes1")
    @ResponseBody
    public AjaxResult shenheYes(TbSeller tbSeller){
        seller1Service.shenheYes1(tbSeller);
        return AjaxResult.R(ResuleEnum.SUCCESS);
    }
}
